
Replication file for
Bailard, Graham, Gross, Porter, & Tromble,
"Combatting Hateful Attitudes and Browsing Behavior: The Case of Antisemitism"
Forthcoming in the Journal of Experimental Political Science

##############################
##  LIST OF FILES           ##
##############################

SCRIPTS  ------------------------------

analysis.R		Performs all analysis except Appendix 3.9.
clean_survey.R		Cleans survey data. Depends on the .sav files and the codebook.
clean_web.R		Cleans web data and performs analysis in Appendix 3.9. Depends
			on files named data_web_pre_raw.csv, data_web_post_raw.csv,
			and list_of_sites.xlsx.

SURVEY DATA  --------------------------

data_survey_completes_raw.sav	Original data file from YouGov.
data_survey_completes_clean.rds	Clean version created by clean_survey.R.
data_survey_breakoffs_raw.sav	Data on breakoffs obtained from YouGov during review process.
data_survey_breakoffs_clean.csv	Clean version created by clean_survey.R.
data_survey_openends.csv	Open-ended responses to treatment prompts. Split off from the raw
				data by clean_survey.R.
data_survey_time.csv		Contains respondent IDs and time began survey. Split off from the
				raw data by clean_survey.R.

BROWSING DATA  ------------------------

data_web_daily_precoded.csv	Source for all _clean web files.
data_web_daily_clean.csv	Clean browsing data aggregated to the respondent x day level.
data_web_weekly_clean.csv	Clean browsing data aggregated to the respondent x week level.
data_web_prepost_clean.csv	Clean browsing data aggregated to the respondent x pre/post treatment
				level. This is the primary file used in the browsing data analysis.

SUPPLEMENTAL FILES  -------------------

codebook.xlsx		Original codebook provided by YouGov. Includes a crosswalk to the
			variable names used in the analysis.
list_of_sites.xlsx	Original file for hand-coding the HA websites.
open_ended.xlsx		Basis for qualitative analysis of open-ended responses in Appendix 2.6.
			Manually edited version of data_survey_openends.csv.
readme.txt		This file.

###############################
##  DATA NOTES               ##
###############################

The paper has two sets of results: attitudes (based on a survey)
and browsing behavior (based on the same respondents' web browsing
histories).

The survey/attitude results can be fully generated from the files
named data_survey_XXX_raw.sav. These are the original files supplied
by the vendor. The other files that begin with data_survey_ are
created by clean_survey.R. They enable analysis.R to run as a
standalone file.

The browsing behavior results required us to collect our respondents'
web browsing histories, which are both sensitive and potentially 
personally identifying. Consequently, this replication file does not 
include the raw browsing data. Instead, the three browsing data files
suffixed _clean are generated from data_web_daily_precoded.csv.
analysis.R uses all three _clean files.

For transparency, clean_web.R contains the full code that we used to
clean the raw browsing data. As a result, it refers to some files that
are not included in this replication file. All of these file paths
include the subdirectory excluded_from_public_file, and are "turned 
off" by using if statements. The portions of the script that are not
"turned off" will run based only on data_web_daily_precoded.csv.

##############################
##  COMPUTING ENVIRONMENT   ##
##############################

The following is the output of utils::sessionInfo(), run immediately 
after the final run of analysis.R.

R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] xtable_1.8-4      texreg_1.38.6     glmnet_4.1-7     
 [4] Matrix_1.5-4      estimatr_1.0.0    coefplot_1.2.8   
 [7] fastDummies_1.6.3 readxl_1.4.2      haven_2.5.2      
[10] lubridate_1.9.2   forcats_1.0.0     stringr_1.5.0    
[13] dplyr_1.1.2       purrr_1.0.1       readr_2.1.4      
[16] tidyr_1.3.0       tibble_3.2.1      ggplot2_3.4.2    
[19] tidyverse_2.0.0  

loaded via a namespace (and not attached):
 [1] utf8_1.2.3        generics_0.1.3    shape_1.4.6      
 [4] lattice_0.21-8    stringi_1.7.12    hms_1.1.3        
 [7] magrittr_2.0.3    grid_4.3.0        timechange_0.2.0 
[10] iterators_1.0.14  useful_1.2.6      foreach_1.5.2    
[13] cellranger_1.1.0  plyr_1.8.8        Formula_1.2-5    
[16] survival_3.5-5    httr_1.4.6        fansi_1.0.4      
[19] scales_1.2.1      textshaping_0.3.6 codetools_0.2-19 
[22] cli_3.6.1         rlang_1.1.1       crayon_1.5.2     
[25] splines_4.3.0     bit64_4.0.5       munsell_0.5.0    
[28] withr_2.5.0       tools_4.3.0       parallel_4.3.0   
[31] reshape2_1.4.4    tzdb_0.4.0        colorspace_2.1-0 
[34] vctrs_0.6.2       R6_2.5.1          lifecycle_1.0.3  
[37] bit_4.0.5         vroom_1.6.3       ragg_1.2.5       
[40] pkgconfig_2.0.3   pillar_1.9.0      gtable_0.3.3     
[43] glue_1.6.2        data.table_1.14.8 Rcpp_1.0.10      
[46] systemfonts_1.0.4 tidyselect_1.2.0  rstudioapi_0.14  
[49] farver_2.1.1      labeling_0.4.2    compiler_4.3.0 